const puppeteer = require("puppeteer");
const url = "https://account.aliyun.com/register/register.html"

async function show(){
    const browser = await puppeteer.launch({
        headless:false,
        defaultViewport:null
    })
    const page = await browser.newPage()
    await page.goto(url);
    // 1.先找到iframe
    var iframe = await page.$("#alibaba-register-box")
    // 2.contentFrame 去获取iframe中的html结构
    var frame = await iframe.contentFrame();
    // 3.抓取
    var span = await frame.waitForSelector(".scale_text")
    var position = await span.boundingBox()
    await page.mouse.move(position.x,position.y)
    await page.mouse.down()
    for(var i=0;i<position.width;i++){
        await page.mouse.move(position.x+i,position.y)
    }
    await page.mouse.up()
    console.log(position);
}
show()